import api from "@/utils/request";

/** 获取用户概览
 * affiliationActivityAssociation.id 团长
 * assembleActivityAreaAssociation.id 区域团长
 * shippingPointInfoVo.pointId 提货点
 */
export const getAccountInfo = (form: {
  accountType: "ASS" | "AREA_ASS" | "POINT";
  userId: string;
}) => {
  return api.get("/finance/mini/account/info", form);
};

/**
 * 提现
 * @param form
 */
export const withdrawal = (form: any) => {
  return api.post("/finance/mini/withdrawal", form);
};

/**
 * 申请提现的列表
 * @param form
 */
export const getWithdrawalList = (form: {
  // 0->团长;1->区域团长;2->提货点
  accountType: string;
  current: number;
  size: number;
  keyword?: any;
  // 对应用户id
  userId: string;
  // 0->全部记录；1->到账记录
  type: string;
}) => {
  return api.get("/finance/mini/withdrawal", form);
};

/**
 * 获取结算设置
 * @param data
 */
export const getManageSetting = () => {
  return api.get("/finance/manage/setting", null);
};

/**
 * 获取上次结算的数据
 * @param data
 */
export const getLastData = (accountType: any) => {
  return api.get("/finance/mini/withdrawal/last", accountType);
};

export const getGroupStS = (data: any) => {
  return api.get("/order/group/overview", data);
};

/**
 * 根据租户id获取店铺当前使用的套餐功能状态（直播 提货点 权限）
 */
export const getShopFunction = (data: any) => {
  return api.get("/platform/shop/get/shop/function", data);
};
